<?php
namespace App\Http\Controllers\Api\V1\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

class AttributeValueResource extends JsonResource
{
    public function toArray($request)
    {
    	$data = $this->resource;
    	
        $data = [
        	'id' => (int)$data->id,
	        'product_id' => $data->product_id,
	        'attribute_key_id' => $data->attribute_key_id,
	        'value' => $data->value ?? '',
	        'created_at' => (string)$data->created_at,
        ];
        
        return $data;
    }
}
